import pygame
from pygame.locals import *
from random import randint


class Badguy(pygame.sprite.Sprite):
    def __init__(self, initial_position, filename="resources/images/01.png", speed=1, health=1, scale=1):
        pygame.sprite.Sprite.__init__(self)
        self.scale = scale
        self.image = pygame.image.load(filename)
        if self.scale == 2:
            self.image = pygame.transform.scale2x(pygame.image.load(filename))
        if self.scale == 3:
            self.image = pygame.transform.scale(pygame.image.load(filename), (3*64, 3*29))
        self.rect = self.image.get_rect()
        self.rect.topleft = initial_position
        self.speed = speed
        self.health = health

    def move(self):
        self.rect.left = self.rect.left - self.speed